feat: modernize monorepo, vitest test suite, nextjs 15 dashboard rewrite, lavalink v4, and cloud docs - #829
Open
PhantomNimbi wants to merge 67 commits into
Open
feat: modernize monorepo, vitest test suite, nextjs 15 dashboard rewrite, lavalink v4, and cloud docs#829PhantomNimbi wants to merge 67 commits into
PhantomNimbi wants to merge 67 commits into
Conversation
…nd update now playing embed
…YouTube device flow auth to console
…s for interactive terminal view
… auth output and file log exclusion
… audit, and API key gating
…thout disk mutation
…d strip trailing JSON delimiters
…Redis keys in Queue.leave() unconditionally
…nce bot & dashboard - Upgrade Next.js to 15.2.0 and migrate App Router to async request APIs (await params, useParams) - Upgrade Auth.js/NextAuth to v5 beta with server action handlers and safe Discord avatar URL resolution - Upgrade @next/eslint-plugin-next to 15.2.0 and align environment parsers to @t3-oss/env-* 0.13.11 - Replace pure-ESM env wrapper in @master-bot/bot with native Zod schema parsing for 100% CJS compatibility - Wire dynamic feature flags (LAVA_ENABLED, GIFS_ENABLED, TWITCH_ENABLED, NEWS_ENABLED, IGDB_ENABLED) across bot preconditions - Connect automated cross-platform PostgreSQL and Redis service checks (connect-or-auto-launch) - Implement dynamic command help registry and standardized help tables across all 60 slash commands - Enhance web dashboard with active-tab sidebar navigation, server overview statistics, and Redis log streaming - Resolve next-themes hydration mismatch by adding suppressHydrationWarning to root layout
…sabled commands - Group slash commands into structured categories (GIFs & Anime, Twitch, News, Games & Entertainment, General & Utilities) - Filter out categories and individual commands disabled globally via environment feature flags (LAVA_ENABLED, GIFS_ENABLED, TWITCH_ENABLED, NEWS_ENABLED, IGDB_ENABLED) - Display server-specific enable/disable toggles and active status badges for all active commands
…ys monorepo-wide - Configure remoteCipher in application.yml with default endpoint (https://cipher.kikkia.dev/) and support custom YOUTUBE_CIPHER_URL / YOUTUBE_CIPHER_PASSWORD - Pass deterministic Java system properties (-D) for YouTube OAuth, skipInitialization, cipher, and Spotify credentials in launcher scripts - Wire YOUTUBE_CIPHER_URL and YOUTUBE_CIPHER_PASSWORD into @master-bot/bot, @master-bot/api, @master-bot/dashboard env schemas and .env.example - Display active cipher endpoint in dev and production console status banners
…ash command, and fix dual-domain auth
… remote cipher, and active music engine
…nds with fuzzy matching and scoring
…t, and add granular audit log dashboard
…on and ticket features
…, and README button
…eholders in app.json
Author
🔄 PR Update: Deferred Interaction Lifecycle & Music Embed StreamliningsequenceDiagram
autonumber
actor User as Discord User
participant Gateway as Discord Gateway
participant Bot as Sapphire Bot Command
participant Channel as Text Channel
User->>Gateway: Slash Command (/play, /reddit, /game-search)
Gateway->>Bot: Interaction Create Event
Bot->>Gateway: deferReply (ephemeral flag)
Note over Bot: Asynchronous Search and API Fetching
Bot->>Gateway: editReply (embeds and components)
Gateway->>Channel: Render Final Response (No Timeout)
📦 Key Enhancements
🧪 Verification & Status
🔗 Pushed Commits
|
Author
🚀 PR Update: Live Interactive Music Embed & Real-Time Progress Barflowchart TD
Start["Track Playback Started"] --> Embed["Render NowPlayingEmbed Progress Bar"]
Embed --> Loop{"Playback Active?"}
Loop -->|"5s Interval"| Tick["Update Progress Bar Display"]
Tick --> Loop
Loop -->|"Stop or Skip"| Stop["Stop Progress Updater and Clear Interval"]
Stop --> Finish["Cleanup Resources"]
📦 Key Enhancements
🧪 Verification & Status
🔗 Pushed Commits
|
Author
📚 PR Update: Documentation Polish, Cross-Platform Wiki Guides & Initial Hardeningflowchart LR
subgraph Docs["Documentation Hierarchy"]
Root["README.md and CONTRIBUTING.md"]
BotDoc["apps/bot/README.md"]
Wiki["wiki/*.md (8 Comprehensive Guides)"]
end
subgraph Platforms["Cross-Platform Deployment Coverage"]
Win["Windows (winget, WSL, Memurai)"]
Mac["macOS (Homebrew, OpenJDK)"]
Linux["Linux (Debian, Arch, Fedora)"]
Cloud["Cloud and Heroku (Buildpacks, Docker)"]
end
Root --> Wiki
BotDoc --> Wiki
Wiki --> Platforms
📦 Key Enhancements
🧪 Verification & Status
🔗 Pushed Commits
|
…ashboard rewrite, and cloud docs - Fix dependency installation on clean clones by switching postinstall to db:generate - Add comprehensive Vitest test harness with 8 unit/integration test suites (16 tests, 100% pass) - Rewrite Next.js 15 App Router web dashboard with glassmorphism UI and dedicated feature studios (Music, Broadcast, Integrations, System Telemetry) - Expand backend tRPC v11 API routers with music, broadcast, and system health procedures - Add multi-cloud hosting guides (Render, Railway, Fly.io, Heroku, Docker VPS) with Mermaid architecture diagrams - Update CI/CD workflow with automatic formatting, linting, type-checking, vitest tests, and production build verification
Author
🌟 Milestone Update: Full Monorepo Audit, Vitest Test Suite & Next.js 15 Dashboard Rewriteflowchart TD
subgraph Audit["Phase 1: Foundation Audit (#831)"]
A1["Fix postinstall to db:generate"] --> A2["turbo.json globalEnv Hardening"]
A2 --> A3["Standardize ESLint Configs"]
end
subgraph Tests["Phase 2: Vitest Test Harness (#832)"]
T1["vitest.config.ts and tsconfig.test.json"] --> T2["8 Test Suites / 16 Tests (100% Pass)"]
T2 --> T3["v8 Coverage Pipeline"]
end
subgraph Dashboard["Phase 3: Next.js 15 Web Dashboard (#834)"]
D1["Glassmorphism UI System"] --> D2["9 Dedicated Feature Studios"]
D2 --> D3["Expanded tRPC v11 API Routers"]
end
subgraph Hardening["Phase 4: Docs and Verification (#835)"]
H1["wiki/Cloud-Hosting.md (Render, Railway, Fly.io)"] --> H2["CI/CD GitHub Actions Pipeline"]
H2 --> H3["Zero-Error Monorepo Verification"]
end
Audit --> Tests
Tests --> Dashboard
Dashboard --> Hardening
📋 Roadmap Milestones CompletedAll 4 sub-tasks under parent roadmap #830 are fully implemented, hardened, and verified:
📦 Key Highlights Pushed in Latest Commit
🧪 Verification Matrix🔗 Pushed Commits
|
Author
🚀 PR Update: Root README Alignment & Accurate API Integration (
|
…osting instructions across Render, Railway, Fly.io, Heroku, Koyeb, Northflank, VPS, and Pterodactyl
…nto unified Cloud Hosting guide
…ogies into unified guides
…ges and root README top-level links
Author
📚 Milestone Update: Complete Wiki Architecture Rewrite & Top-Level Navigation (
|
Author
🏷️ Quality & Standardization: Project Name Alignment (
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Monorepo Modernization, SQLite DB, In-Memory Audio Queue, Vitest Suite & Next.js 15 Web Dashboard Rewrite
This pull request delivers a comprehensive, production-grade modernization of the Master-Bot monorepo. It migrates the database layer to embedded SQLite via Prisma ORM, implements in-memory audio queues (eliminating PostgreSQL and Redis requirements), introduces resilient gateway intent fallback, establishes a 16-test Vitest test suite, rewrites the Next.js 15 App Router web dashboard with 9 feature studios, isolates port bindings across 3 ports (
3000,3001,3002), and synchronizes extensive documentation acrosswiki/andREADME.md.🗺️ Monorepo Architecture Overview
flowchart TD subgraph Apps["Applications (apps/)"] Bot["apps/bot<br/>(Sapphire Framework & discord.js v14)"] Dash["apps/dashboard<br/>(Next.js 15 App Router)"] end subgraph Packages["Shared Packages (packages/)"] API["packages/api<br/>(tRPC v11 Routers)"] Auth["packages/auth<br/>(NextAuth.js v5)"] DB["packages/db<br/>(Prisma ORM Client)"] Config["packages/config<br/>(ESLint & Tailwind)"] end subgraph Storage["Storage & Media Layer"] SQLite[("SQLite Database<br/>(file:./db.sqlite)")] MemQueue["In-Memory Audio Queue Engine"] Lava["Lavalink v4 Audio Server"] Discord["Discord Gateway & REST API v10"] end Dash --> API Dash --> Auth Bot --> API API --> DB Auth --> DB DB --> SQLite Bot --> Lava Bot --> MemQueue Bot --> Discord API --> Discord📋 Tracking & Linked Issues
📦 Key Architectural Deliverables
1. 💾 Zero-Config SQLite Database & In-Memory Audio Queues
provider = "sqlite"andfile:./db.sqlite. JSON string serialization for multi-value array fields.Queue._tracks), eliminatingioredisand Redis server requirements.pnpm install && pnpm devwithout configuring external database services or Docker daemons.2. 🛡️ Resilient Gateway Client & Pure Slash Architecture
GuildMembersintent to standard intents uponDisallowedIntentserror at login.loadMessageCommandListeners: false).3. 🌐 Next.js 15 Web Dashboard Rewrite & 9 Feature Studios
/dashboard/music), Broadcaster (/dashboard/broadcast), Audit Logs (/dashboard/logs), Support Tickets (/dashboard/[server_id]/tickets), Twitch Stream Tracking (/dashboard/integrations), Cluster Diagnostics (/dashboard/system), Reminders (/dashboard/reminders), Welcome Greetings (/dashboard/[server_id]/welcome-message), and Command Controls (/dashboard/[server_id]/commands).4. 🔌 3-Port Isolation & Dynamic NextAuth URL Resolution
DASHBOARD_PORT=3000(Next.js Dashboard)BOT_PORT=3001(Bot Runtime & Gateway)BOT_API_PORT=3002(Bot Internal HTTP API)DASHBOARD_PORT, eliminatingNEXTAUTH_URL_INTERNAL.5. 🧪 Vitest Test Suite (16/16 Passing Tests)
tests/unit/config.test.ts: Turborepo pipeline and package parity.tests/unit/scripts/common.test.ts: Monorepo launcher directory resolution.tests/unit/env.test.ts: Environment schema validation and 3-port isolation.tests/unit/db/prisma.test.ts: PrismaClient singleton and schema models.tests/unit/bot/constants.test.ts: Bot directory paths and module locations.tests/unit/auth/auth-config.test.ts: NextAuth provider configuration.tests/unit/api/routers.test.ts: tRPC procedures across 15 router namespaces.tests/integration/dashboard-api.test.ts: Authenticated caller context and security.6. 📚 Universal Portability & Documentation Sync
README.md,.env.example,docker-compose.yml, and all 34wiki/articles.📊 Verification Matrix